package com.symone.webcms.mapper;


import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.symone.webcms.model.User;
import com.symone.webcms.model.vo.UserInfoVO;
import com.symone.webcms.model.vo.UserVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 系统用户表 Mapper 接口
 * </p>
 *
 * @author ArcherChu
 * @since 2018-10-30
 */
public interface UserMapper extends BaseMapper<User> {

    UserVO findUserByUserName(String username);

    UserVO findUserByEmail(String email);

    UserVO findUserByMobile(String mobile);

    boolean deleteFlagById(long id);

    List<UserInfoVO> selectUserListByParameters(Page<UserInfoVO> page, @Param("userName") String userName, @Param("mobile") String mobile, @Param("email") String email, @Param("roleId") String roleId, @Param("state") Integer state);

    int updatePassword(@Param("id") Long id, @Param("password") String password, @Param("userName") String userName, @Param("mobile") String mobile, @Param("email") String email);

    int updateUser(@Param("id") Long id, @Param("userName") String userName, @Param("mobile") String mobile, @Param("email") String email, @Param("nickName") String nickName, @Param("avatar") String avatar, @Param("roleId") Long roleId);

    int updateUser(@Param("id") Long id, @Param("userName") String userName, @Param("mobile") String mobile, @Param("email") String email, @Param("nickName") String nickName, @Param("password") String password, @Param("avatar") String avatar, @Param("roleId") Long roleId, @Param("state") Integer state);
}
